package com.topvision.common.response;

/**
 * @author shengwm
 * @version V0.0.1
 * @Title: ErrorResponse
 * @Package com.topvision.common.vo
 * @Description: TODO
 * @date 2017/3/28
 */
public class ErrorResponse {

    /**
     * 是否请求成功
     */
    protected Boolean success;

    /**
     * 错误消息 "密码错误"
     */
    protected String message;

    /**
     * 错误码  "password_error"
     */
    protected String errorCode;


    public ErrorResponse() {
        this.success = Boolean.FALSE;
    }

    protected ErrorResponse(final String errorCode, final String message) {
        this.success = Boolean.FALSE;
        this.errorCode = errorCode;
        this.message = message;
    }

    public static ErrorResponse of(final String errorCode, final String message) {
        return new ErrorResponse(errorCode, message);
    }

    public static ErrorResponse of() {
        return new ErrorResponse("-1", "操作失败");
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
}
